const Koa = require('koa');
const logger = require('koa-logger');
const cors = require('@koa/cors');
const json = require('koa-json');

const router = require('./routes/index');

const app = new Koa();

app.use(logger());
app.use(cors());
app.use(json());
app.use(router.routes());
app.use(router.allowedMethods());
app.listen(9002,()=>{
    console.info('koa starts at port 9002!');
});
